package com.itheima.常用API;

public class SystemDemo {
    public static void main(String[] args) {
        int[]arr1={1,2,3,4,5,6};
        int []arr2=new int[11];
        //将arr1最后两个数copy到arr2的最后位置
       /* System.arraycopy(arr1,arr1.length-2,arr2,arr2.length-2,2);
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }*/
        //需求，将arr1中的前两个元素，拷贝到arr2中
                System.arraycopy(arr1,0,arr2,0,2);
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }
    }

}
